#ifdef EXAMPLECGAL_EXPORTS
#define EXAMPLECGAL_API __declspec(dllexport)
#else
#define EXAMPLECGAL_API __declspec(dllimport)
#endif

#define PI 3.14159265358979323846
#define FRACT_STEP 0.5
#define DIST_STEP 0.001
#define MAX_ITER 20

//Generazione type di CGAL

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_2 Point;
typedef CGAL::Bbox_2 Bbox_2;
typedef CGAL::Point_2<K>::Cartesian_const_iterator C_iterator;
typedef K::Segment_2 Segment;
typedef CGAL::Polygon_2<K> Polygon_2;
typedef CGAL::Straight_skeleton_2<K> StraightSkeleton;

typedef boost::shared_ptr<StraightSkeleton> SharedPointer;

typedef std::vector<Point> Point_vector;
typedef std::vector<Point>::iterator Point_iterator;
typedef std::vector<Segment> Segment_vector;
typedef std::vector<Segment>::iterator Segment_iterator;

typedef StraightSkeleton::Vertex_const_handle V_handle;
typedef StraightSkeleton::Vertex_const_iterator V_iterator;
typedef StraightSkeleton::Halfedge_const_handle He_handle;
typedef StraightSkeleton::Halfedge_const_iterator He_iterator;
typedef Polygon_2::Edge_const_iterator Ep_iterator;
typedef Polygon_2::Edge_const_circulator Ep_circulator;
typedef Polygon_2::Vertex_const_iterator Vp_iterator;
typedef Polygon_2::Vertex_const_circulator Vp_circulator;

//Funzioni che usano CGAL

EXAMPLECGAL_API SAFEARRAY * CALLBACK skeleton(SAFEARRAY **,bool);
EXAMPLECGAL_API SAFEARRAY * CALLBACK simplify(SAFEARRAY **,double,double,bool);

//Funzioni ausiliarie

EXAMPLECGAL_API void remove_with_dist(Polygon_2 &,double);

EXAMPLECGAL_API double angle_Xaxis(Point,Point);
EXAMPLECGAL_API double angle_Xaxis(Segment);
EXAMPLECGAL_API double angle_3points(Point,Point,Point);
EXAMPLECGAL_API double angle_2segments(Segment,Segment);
EXAMPLECGAL_API Polygon_2 convex_hull(Polygon_2);

EXAMPLECGAL_API Polygon_2 safe2poly(SAFEARRAY **);
EXAMPLECGAL_API SAFEARRAY * poly2safe(Polygon_2);